package com.menhai.personmanagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.menhai.personmanagement.entity.SysNav;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysNavMapper extends BaseMapper<SysNav> {

    @Select("select * from sys_nav where level = #{level} order by levelnum,`order`")
    public List<SysNav> getNav(@Param("level") String level);

//    @Select("select * from sys_nav where level = #{level} and levelnum= #{levelnum} order by levelnum,`order`")
//    public List<SysNav> getNavByLevelnum(@Param("level") String level, @Param("levelnum") String levelnum);
//
//    @Select("select * from sys_nav where level = #{level} and levelnum >= #{levelnum} order by levelnum,`order`")
//    public List<SysNav> getNavByLevelnumTwo(@Param("level") String level, @Param("levelnum") String levelnum);

    @Select("select * from sys_nav where levelnum= #{levelnum} order by levelnum,`order`")
    public List<SysNav> getNavByLevelnum(@Param("level") String level, @Param("levelnum") String levelnum);
    @Select("select * from sys_nav where navId in (${ids}) and  levelnum = #{levelnum} order by levelnum,`order`")
    public List<SysNav> getNavListByNavids(@Param("ids") String ids,@Param("levelnum") String levelnum);
    @Select("select * from sys_nav where levelnum >= #{levelnum} order by levelnum,`order`")
    public List<SysNav> getNavByLevelnumTwo(@Param("level") String level, @Param("levelnum") String levelnum);

    @Select("select * from sys_nav where labelName= #{labelName} order by levelnum,`order` desc ")
    public List<SysNav> getNavOne(@Param("labelName") int labelName);

    @Select("select * from sys_nav where levelnum = 2")
    public List<SysNav> getAllLevelTwo();


    List<SysNav> sysroleBypowerslist(@Param("level") String level);


    List<SysNav> sysroleBypowerslistfixed(@Param("stringpowers") String[] stringpowers);

}
